<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jquery/jquery.min.js"></script>
    <script>
        $(function () {
            //ajax只有get和post方法.使用ajax可以发送其他类型的方式
            $('#submitBtn').click(function () {
                $.ajax({
                    type:"post",
                    contentType:"application/json;charset=utf-8",
                    url:"/employees/post",
                    data:'{"name":"admin","id":1}'

                });
            });

            //delete请求
            $('#delBtn').click(function () {
                $.ajax({
                    type:"delete",
                    url:"/employees/delete/5"
                });
            });




            //put请求,需要配置httpPutFormContentFilter
            $('#putBtn').click(function () {
                $.ajax({
                    type:"put",
                    url:"/employees/put/100"
                });
            });




        })


    </script>
</head>
<body>
    <button id="submitBtn">ajax提交</button>
    <button id="delBtn">删除</button>
    <button id="putBtn">put请求</button>

    <form action="/employees/putform/1789" method="post">
`       <input type="hidden" name="_method" value="put">
        <input type="submit" value="put表单提交"/>
    </form>
</body>
</html>